//
//  ViewController.m
//  02_LaGou
//
//  Created by dllo on 16/7/16.
//  Copyright © 2016年 yh. All rights reserved.
//

#import "ViewController.h"
#import "ImageTextView.h"
#import "RegViewController.h"
#import "ForgetViewController.h"
#define WIDTH self.view.frame.size.width
#define HEIGHT self.view.frame.size.height
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    self.view.backgroundColor = [UIColor whiteColor];
    UIView *backView = [ImageTextView createBackViewFrame:self.view.frame];
    [self.view addSubview:backView];
    
    UIView *textFieldView = [ImageTextView createViewFrame:CGRectMake(10, 350, WIDTH - 20, 82) backGroundColor:[UIColor clearColor]];
    [backView addSubview:textFieldView];
    
    UIImageView *logoImageView = [ImageTextView createLogeViewFrame:CGRectMake(WIDTH / 2 - 60, 100, 120, 200)];
    [self.view addSubview:logoImageView];
    
    UIButton *logButton = [ImageTextView createLoginButtonFrame:CGRectMake(10, 455, WIDTH - 20 , 40)];
    [self.view addSubview:logButton];
    
    UIButton *forgetButton = [ImageTextView createForgetKeyButtonFrame:CGRectMake(7, 510, 80, 40)];
    [self.view addSubview:forgetButton];
    [forgetButton addTarget:self action:@selector(forgetClick:) forControlEvents:UIControlEventTouchUpInside];

    
    UIButton *regButton = [ImageTextView createRegButtonFrame:CGRectMake(120, 540, WIDTH - 240, 40)];
    [self.view addSubview:regButton];
    [regButton addTarget:self action:@selector(logClick:) forControlEvents:UIControlEventTouchUpInside];
    
    UIView *lineView = [ImageTextView createLineFrame:CGRectMake(0, 610, WIDTH, 30)];
    [self.view addSubview:lineView];
    
    UIButton *strollButton = [ImageTextView createStrollButtonFrame:CGRectMake(WIDTH / 2 - 75, 640, 160, 40)];
    [self.view addSubview:strollButton];
    
}

- (void)logClick:(UIButton *)button {
    RegViewController *reg = [[RegViewController alloc] init];
    [self presentViewController:reg animated:YES completion:nil];
}

- (void)forgetClick:(UIButton *)button {
    ForgetViewController *forget = [[ForgetViewController alloc] init];
    [self presentViewController:forget animated:YES completion:nil];
    

}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
